package com.xxh.dataaccess.rpcservice;

import net.devh.boot.grpc.client.inject.GrpcClient;
import org.springframework.stereotype.Service;

/**
 * Grpc远程调用服务封装
 */
@Service
public class ClientGrpcService {

    @GrpcClient("myClient")
    RpcRecServiceGrpc.RpcRecServiceBlockingStub recServiceBlockingStub;

    public void rpcUpdateUserProfileRecallByUid(String uid) {
        RecallService.RecRequest request = RecallService.RecRequest
                .newBuilder()
                .setUid(uid)
                .build();
        System.out.println(recServiceBlockingStub.genUserProfileRecallByUid(request).getMessage());
    }

    public void rpcUpdateUserHistoryRecall() {
        RecallService.RecRequest request = RecallService.RecRequest
                .newBuilder()
                .setUid("3")
                .build();
        System.out.println(recServiceBlockingStub.updateUserHistoryRecall(request).getMessage());
    }


    public void rpcUpdateUserProfileRecall() {
        RecallService.RecRequest request = RecallService.RecRequest
                .newBuilder()
                .setUid("3")
                .build();
        System.out.println(recServiceBlockingStub.updateUserProfileRecall(request).getMessage());
    }


}
